import React from "react";
import PropTypes from "prop-types";
import { NavBar } from "antd-mobile";
import "./MyNavBar.scss";

function MyNavBar(props) {
  const { title } = props;

  // 点击返回
  const handleBack = () => {
    console.log(123);
  };
  return <NavBar onBack={handleBack}>{title}</NavBar>;
}

// 父传参
MyNavBar.defaultProps = {
  title: "个人中心",
};

// 类型
MyNavBar.propTypes = {
  title: PropTypes.string,
};

export default MyNavBar;
